<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<#import "/page.ftl" as page />
	<link rel="stylesheet" type="text/css" href="/css/work_report.css">
	<link rel="stylesheet" type="text/css" href="/css/work_attend.css">
	<script type="text/javascript" src="/js/work_attend.js"></script>
	<div class="content-wrapper attend">
		<#include "/head.ftl"/>
		<div class="content">
			<div class="main-hd">
				<div class="work-time">
					<span></span>
					<div class="diawo" ><i class="iconfont icon-rili"></i></div>
				</div>
				<div class="work-da">
					<div class="work-t go">
						<span>上班：</span> 
						<span class="gui-time">${userinfo.dept.beginTime?string("HH:mm")}</span>
						<#if go?exists>
							<div class="xin">
							<span style="font-size: 14px; margin-left: 15px;">打卡时间：</span>
								<#if go.status==1>
									<span class="da-time" style="color: red;">${go.time?string("HH:mm")}</span>
								<#else>
									<span class="da-time">${go.time?string("HH:mm")}</span> 
								</#if>
								<span class="ip">IP: <span>${go.ip}</span></span>
									<div class="caozu">
									<#if go.ac?exists&&go.ac.id!=0>
										<span>${go.remark}</span>
										<#else>
										<#if go.status==1>
											<a class="an xiao" data-id="${go.id}">取消迟到</a>
										</#if>
									</#if>
								</div>
							</div>
						</#if>
							
					</div>
					<div class="work-t out">
						<span>下班：</span> 
						<span class="gui-time">${userinfo.dept.endTime?string("HH:mm")}</span>
						<#if out?exists>
							<div class="xin">
								<span style="font-size: 14px; margin-left: 15px;">打卡时间：</span> 
								<#if out.status==2>
									<span class="da-time" style="color: red;">${out.time?string("HH:mm")}</span>
								<#else>
									<span class="da-time">${out.time?string("HH:mm")}</span> 
								</#if>
								<span class="ip">IP: <span>${out.ip}</span></span>
								<div class="caozu">
									<#if out.ac?exists&&out.ac.id!=0>
										<span>${out.remark}</span>
										<#else>
										<#if go.status==2>
											<a class="an xiao" data-id="${out.id}">取消早退</a>
										</#if>
									</#if>
									<a class="an chong" data-id="${out.id}">重新签退</a>
								</div>
							</div> 
						</#if>
							
					</div>
					<#if !go?exists||!out?exists>
					<div class="punch-clock">
					<#if jia??>
						<div style="display: none;" class="xiuxi">休息</div>
					<#else>
						<#if !go?exists>
							<div class="type">签到</div>
						<#elseif !out?exists>
							<div class="type">签退</div>
						</#if>
						<div class="t"></div>
					</#if>
					</div>
					</#if>
				</div>

			</div>
			<div class="tab-content">
				<div>
					<table
						style="width: 100%; border-collapse: collapse; background: #fff;">
						<thead>
							<tr>
								<th>打卡时间</th>
								<th>考勤类型</th>
								<th>考勤状态</th>
								<th>IP</th>
								<th>申诉状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
						<#if !((wa.content)?size gt 0)>
							<tr><td colspan="6">您目前没有打卡记录~ </tr>
						</#if>
						<#list (wa.content) as w>
							<tr>
								<td>${w.time}</td>
								<td>${w.type}</td>
								<#list status['work_attend'] as status>
									<#if status.value==w.status>
										<td><span style="font-weight: 600;background:${(status.color)!''}"  class="btn">${status.name}</span></td>		
									</#if>
								</#list>
								<td>${w.ip}</td>
								<td>
								<#if w.status!=0 || w.ac?exists>
									<#if w.ac?exists && w.ac.state==2>
									<a class="seecom" data-id="${w.ac.id}" data-acname="${w.ac.user.realName}" data-s="${w.ac.state}">${w.remark}</a>
									<#else>
									${w.remark}
									</#if>
								<#else>
									${w.remark}
								</#if>
								</td>
								<td>
								<#if w.status!=0 && !w.ac?exists>
									<a class="btn btn-appeal " data-id='${w.id}' data-time='${w.time}'><i class="iconfont icon-kaoqinshensu"></i><span> 申诉</span></a>
								<#else>
									<span style="color: #ccc;">无</span>
								</#if>
								</td>
							</tr>
						</#list>
						</tbody>
					</table>
				</div>
				<@page.page url=requestURI pager=wa/>
			</div>
			
			<div class="appeal" style="display: none; padding: 0 40px;">
				<div class="ap-h">申请消除：  <span></span></div>
				<div class="ap-r">
					<span class="et"><span style="color: red;">*</span>申请原因：</span>
					<textarea rows="" cols=""></textarea>
				</div>
			</div>
			
			<div class="appeal2" style="display: none; padding: 0 40px;">
				<div class="ap-h jie">处理结果：  <span></span></div>
				<div class="ap-h ren">处  理  人 ：  <span></span></div>
				<div class="ap-h ti">处理时间：  <span></span></div>
				<div class="ap-h shuo">处理说明：  <span></span></div>
			<div style="width: 100%;border-top: 1px solid #ccc;margin: 7px;"></div>
				<div class="ap-h we">申请消除：  <span></span></div>
				<div class="ap-r">
					<span class="et"><span style="color: red;">*</span>申请原因：</span>
					<textarea style="min-height: 100px;" placeholder="请重新填写申请原因"></textarea>
				</div>
			</div>
			<div class="calendarwe" style="display: none;">
			<div id="cc" class="easyui-calendar"
				style="width: 100%; height: 220px;" firstDay="1"></div>
			</div>
			
			<div class="model" style="display: none;height: 100%;">
				<table class="md-tab">
					<tbody>
					<tr>
						<td class="ts" rowspan="2" style="width: 160px;font-size: 14px;">2017-10-15</td>
						<td class="qian">
							<div class="pull-left">
								<span style="color: #666;">签到</span>
								<span class="stat">迟到</span>
							</div>
							<div class="pull-right">
								<span class="caoz">取消迟到</span>
							</div>
						</td>
					</tr>
					<tr>
						<td class="tui">
							<div class="pull-left">
								<span style="color: #666;">签退</span>
								<span class="stat">早退</span>
							</div>
							<div class="pull-right"><span class="caoz">取消早退</span></div>
						</td>
					</tr>
					</tbody>
				
				</table>
			</div>
		</div>
</body>
</html>